<template>
  <div>
    <el-table
      :data="tableData"
      v-loading="showLoading"
      :header-cell-style="{ background: 'rgb(245,247,250)' }"
      :row-style="{ height: '10px' }"
      height="480"
      stripe
      border
      style="width: 100%;font-size: 12px;width: 100%;margin-top:10px">
      <el-table-column
        label="查询状态"
        align="center">
        <template slot-scope="scope">
          <el-tag v-if="scope.row.status=='0'" type="info">未查阅</el-tag>
          <el-tag v-if="scope.row.status=='1'" type="success">已查阅</el-tag>
        </template>
      </el-table-column>
      <el-table-column
        align="center"
        prop="name"
        label="消息标题">
      </el-table-column>
      <el-table-column
        align="center"
        prop="date"
        label="推送日期">
      </el-table-column>
      <el-table-column
        label="操作"
        align="center">
        <template slot-scope="scope">
          <el-button type="primary" size="small"  @click="showInfo(scope.row)">查看详情</el-button>
        </template>
      </el-table-column>
    </el-table>
    <el-dialog
      :title="moreInfo.name"
      :visible.sync="dialogVisible"
      width="30%"
      append-to-body="true">
      <span>{{moreInfo.message}}</span>
      <span slot="footer" class="dialog-footer">
    <el-button type="primary" @click="dialogVisible = false" size="small">确 定</el-button>
  </span>
    </el-dialog>
  </div>
</template>

<script>
export default {
  name: "tableMessage",
  props:{
    tableData:{
      type:Array,
    },
    showLoading:{
      type:Boolean,
      default:true,
    }
  },
  data(){
    return{
      dialogVisible: false,
      moreInfo:{}
    }
  },
  methods:{
    showInfo(e){
      this.dialogVisible=true;
      this.moreInfo=e;
    }
  }
}
</script>

<style scoped>

</style>
